<template>
  <header class="header">
    <h1>任务列表</h1>
    <input class="new-todo" @keyup.enter="add" placeholder="请输入要做的事情" autofocus v-model.trim="todoList"/>
  </header>
</template>

<script>
export default {
  data(){
    return {
      todoList:''
    }
  },
  methods:{
    add() {
      this.$emit("handleAddList",this.todoList)
      this.todoList=''
    }
  }
}
</script>

<style></style>
